﻿using LDC_Shop_B.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LDC_Shop_B.Serives
{
    public interface ICarService
    {
        /// <summary>
        /// 添加购物车
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="goodId"></param>
        void AddCar(string userId, int goodId);

        /// <summary>
        /// 减少购物车数量
        /// </summary>
        void DiffCar(string userId, int goodId);

        /// <summary>
        /// 移除购物车商品
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="goodId"></param>
        void RemoveCar(string userId, int goodId);

        /// <summary>
        /// 获取购物车商品
        /// </summary>
        /// <returns></returns>
        List<CarGoods> GetCarGoods(string userId);

        /// <summary>
        /// 添加购物车
        /// </summary>
        bool AddCarForSQL(int userId, int goodId);

        /// <summary>
        /// 减少购物车
        /// </summary>
        bool DiffCarForSQL(int userId, int goodId);

        /// <summary>
        /// 删除购物车商品
        /// </summary>
        /// <returns></returns>
        bool DeleteCarForSQL(int userId, int goodId);
        /// <summary>
        /// 清空购物车商品
        /// </summary>
        /// <returns></returns>
        bool RemoveCarForSQL(int userId);
        /// <summary>
        /// 查询购物车商品
        /// </summary>
        /// <returns></returns>
        List<CarGoods> GetCarGoodsForSQL(int userId);
    }
}
